﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Columbus
{
    public class ConstructorNotFoundException : Exception
    {
        public ConstructorNotFoundException(Type viewModelType, IEnumerable<string> constructorParameterNames)
            : base(String.Format("Can not find {0} type constructor matching parameters saved in view state: {1}",
                                 viewModelType,
                                 constructorParameterNames.Aggregate(new StringBuilder(),
                                                                     (result, element) =>
                                                                     result.AppendFormat("{0} ", element))))
        {
        }
    }
}